<template>
  <div>
    <NavType/>
    <List/>
    <Recommend/>
    <Rank/>
    <Like/>
    <Floor v-for="floor in floorList" :key="floor.id" :floor="floor"/>
    <Brand/>
  </div>
</template>

<script>
import {requestFloorList} from '@/api'
import List from './List'
import Recommend from './Recommend'
import Rank from './Rank'
import Like from './Like'
import Floor from './Floor'
import Brand from './Brand'
export default {
  name:"Home",
  data() {
    return {
      floorList:[]
    }
  },
  components:{
    List,
    Recommend,
    Rank,
    Like,
    Floor,
    Brand
  },
  mounted() {
    //获取floor
    this.getFloorList()
  },
  methods: {
    //封装获取floor数据，避免组件复用导致频繁请求
    async getFloorList(){
      const re = await requestFloorList()
      this.floorList = re
    }
  },
}
</script>

<style scoped lang="less">

</style>